package test4;

import java.io.FileInputStream;
import java.io.FileOutputStream;

public class test {
    public static void main(String[] args){
        FileInputStream fis=null;
        FileOutputStream fos=null;
        try {
            fis=new FileInputStream("e:\\a.gif");
            fos=new FileOutputStream("e:\\b.jpg");
            byte[] buf=new byte[1024];
            int n;
            while((n=fis.read(buf))!=-1){
               fos.write(buf);
            }
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            try {
                fis.close();
                fos.close();
            }catch (Exception e){
                e.printStackTrace();
            }

        }
    }
}
